Ext.define('appmod.controller.framework.Viewport', {
    extend: 'Ext.app.Controller',
    
    views: [
    	'framework.MainCorePanel',
		'framework.MainMenuPanel'
    ],
	
    refs: [
		{ref: 'mainCorePanel',selector:'maincorepanel'}
	],
	
    init: function() {
		

		me = this;

		// --- get the element and define html ---
		var elems = Ext.select("td a");
		for (var i = 0 ; i < elems.getCount() ; i++) {
			var adminMenuElem = elems.item(i);
			var act = adminMenuElem.getAttribute('action');
			if (act != null) {
				adminMenuElem.on('click',me.linkInPanel,me,act);
			}
		}		
		
		
		
    	this.control({

			'mainmenupanel': {

			}

    	});


    },
	
	// --- use this app lication
	onLaunch:function() {
		
		// --- get core panel --

	},

	linkInPanel:function(e, t, url) {
		var corePanel = this.getMainCorePanel();
		corePanel.setSrc(url);		
	}
	

});